import Vue from "vue";
import App from "./App.vue";

//引入router对象
import router from "@/router";
//引入vuex
import store from "@/store";

//引入NavType组件
import NavType from "@comp/NavType";
import Swiper from "@comp/Swiper";
import Pagenation from "@comp/Pagenation";

Vue.config.productionTip = false;

//全局注册NavType组件
Vue.component("NavType", NavType);
Vue.component("Swiper", Swiper);
Vue.component("Pagenation", Pagenation);

//把mock引入项目 让mockServer执行
import "@/mock/mockServer";

new Vue({
  render: (h) => h(App),
  //把router路由对象注册到实例上，那么所有的组件实例上都有有一个$router和$route对象
  router,
  //把store注册到实例上,那么所有的组件实例都可以访问$store对象
  store,

  //事件总线的设置(注意:千万不要写在mounted中,请参考父子组件的生命周期流程)
  beforeCreate() {
    Vue.prototype.$bus = this;
  },
}).$mount("#app");
